﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CleverDD.Model.Communication.PLC
{
    public class PlcAddressInfoEntity : BaseEntity
    {
        public Guid PlcInfoGuid;
        public int PlcInfoId;
        public string Address = "";
        public string Name = "";
        public PlcDataType DataType = PlcDataType.Short16;
       
        public EncodingType EncodingType = EncodingType.None;
        public PlcState State = PlcState.启用;
        public int Length;
        public string ReMark = "";
        public string DefaultValue = "";

        [JsonIgnore]
        public bool ReadSuccess;
        [JsonIgnore]
        public string Value = "";

    }

    public enum EncodingType
    {
        None,//默认值  即不传的时候
        Default,
        Ansi,
        Gb2312,
        Utf8,
        Ascii,
        Unicode,
        Utf32,
        BigEndianUnicode,
    }

    public enum PlcType
    {
        西门子1200,
        西门子1500,
        西门子300,
        西门子400,
        西门子200Smart,
        基恩士Binary,
        三菱MelsecMcNet,

    }


    public enum PlcDataType
    {
        Bool1,
        Byte8,
        Short16,
        UShort16,
        Int32,
        UInt32,
        Long64,
        ULong64,
        Float单精度,
        Doubles双精度,
        String字符串,
    }

    public enum PlcState
    {
        启用,
        停用,
        默认值,
    }
}
